import { computed,unref } from "vue"
import {SYSTEM_Window_INFO,MENU_BUTTON_RECT_INFO} from "@/utils/config.js"
//状态栏高度 (时间、电量)
//SYSTEM_Window_INFO.statusBarHeight
export const statusBarH=computed(()=>SYSTEM_Window_INFO.statusBarHeight || 25)
//标题栏高度
export const titleBarH=computed(()=>{
	const {top,height} = MENU_BUTTON_RECT_INFO;
	if (!top||!height) return 40;
	//top - unref(statusBarH) 得到上边框
	// 导航栏高度 = 上边距 + 按钮高度 + 下边距
	return height+((top-unref(statusBarH))*2)
})
export const navBarH=computed(()=>unref(statusBarH)+unref(titleBarH))
//封装导航栏
export const useNavBarStyle=()=>{
	//直接拿statusBarH会得到ref对象,unref得到原始值
	const statusBarHeight=computed(()=>unref(statusBarH)+"px");
	const titleBarHeight=computed(()=>unref(titleBarH)+"px");
	const headHeight=computed(()=>unref(navBarH)+"px");
	return {statusBarHeight,titleBarHeight,headHeight}
}





